package com.school.device.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public abstract class DateTimeUtil {		
	private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
	
	public static Long getCurrentTimestamp() {
		return System.currentTimeMillis();
	}
		
	public static String getCurrentDateTime() {
		Date date = new Date(getCurrentTimestamp());
		return sdf.format(date);
	}
	
	public static Long getStartTimeStamp() {//开始在一秒前
		return ((System.currentTimeMillis()/1000)-3)*1000;
	}
		
	public static String getStartDateTime() {
		Date date = new Date(getStartTimeStamp());
		return sdf.format(date);
	}
	
	public static Long getPreviousPlusTimeStamp() {//开始在一秒前
		return ((System.currentTimeMillis()/1000)-1)*1000;
	}
		
	public static String getPreviousPlusDateTime() {
		Date date = new Date(getPreviousPlusTimeStamp());
		return sdf.format(date);
	}
	
	public static Long getPreviousTimeStamp() {//开始在一秒前
		return ((System.currentTimeMillis()/1000)-1)*1000;
	}
		
	public static String getPreviousDateTime() {
		Date date = new Date(getPreviousTimeStamp());
		return sdf.format(date);
	}
	
	
	public static Long getNextTimeStamp() {//开始在一秒前
		return ((System.currentTimeMillis()/1000)+1)*1000;
	}
		
	public static String getNextDateTime() {
		Date date = new Date(getNextTimeStamp());
		return sdf.format(date);
	}
	
	public static Long getNextPlusTimeStamp() {//开始在一秒前
		return ((System.currentTimeMillis()/1000)+2)*1000;
	}
		
	public static String getNextPlusDateTime() {
		Date date = new Date(getNextPlusTimeStamp());
		return sdf.format(date);
	}
	
	
	public static Long getEndTimeStamp() {
		return (System.currentTimeMillis()/1000+3)*1000+999;
	}
		
	public static String getEndDateTime() {
		Date date = new Date(getEndTimeStamp());
		return sdf.format(date);
	}
		
}
